#!/bin/bash
ARCH=$1

source config.sh $ARCH
NOW_DIR=$(cd `dirname $0`; pwd)
LIBS_DIR=$NOW_DIR




# 输出路径
PREFIX=$LIBS_DIR/android/$AOSP_ABI

# 头文件目录
FDK_INCLUDE=$LIBS_DIR/libs/libfdk-aac/$AOSP_ABI/include
# 库文件目录
FDK_LIB=$LIBS_DIR/libs/libfdk-aac/$AOSP_ABI/lib
X264_INCLUDE=$LIBS_DIR/libs/libx264/$AOSP_ABI/include
X264_LIB=$LIBS_DIR/libs/libx264/$AOSP_ABI/lib

./configure \
--target-os=android \
--prefix=$PREFIX \
--enable-cross-compile \
--disable-runtime-cpudetect \
--disable-asm \
--arch=$AOSP_ARCH \
--cc=$CC \
--cxx=$CXX \
--cross-prefix=$CROSS_PREFIX \
--extra-cflags="-I$X264_INCLUDE  -I$FDK_INCLUDE  $FF_CFLAGS" \
--extra-cxxflags="$FF_EXTRA_CFLAGS" \
--extra-ldflags="-L$X264_LIB -L$FDK_LIB" \
--extra-libs=-lm \
--sysroot=$SYS_ROOT \
--disable-static \
--enable-shared \
--enable-jni \
--enable-mediacodec \
--enable-pic \
--enable-gpl \
--enable-libx264 \
--enable-nonfree \
--enable-libfdk_aac
make clean
make -j4
make install

